package com.horizon.cloud.standard.lock;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.concurrent.locks.Lock;

/**
 * redis锁服务：
 * 1.获取分布式锁
 * 2.获取分段锁
 */
@Slf4j
@Data
@Service
public class RedisLockService {

    public RedisLockService() {
    }


    //获取锁
    public Lock getLock(String lockKey, String requestId) {
        JedisLock lock = new JedisLock(lockKey, requestId);
        return lock;
    }
}
